/*=========================================================================================
  File Name: actions.js
  Description: Vuex Store - actions
==========================================================================================*/

const actions = {

    updateSidebarWidth({ commit }, width) {
      commit('UPDATE_SIDEBAR_WIDTH', width);
    },
    updateI18nLocale({ commit }, locale) {
      commit('UPDATE_I18N_LOCALE', locale);
    },
    toggleContentOverlay({ commit }) {
      commit('TOGGLE_CONTENT_OVERLAY');
    },
    updateTheme({ commit }, val) {
      commit('UPDATE_THEME', val);
    },
    updateUserRole({ commit }, val) {
      commit('UPDATE_USER_ROLE', val);
    },
    updateWindowWidth({ commit }, width) {
      commit('UPDATE_WINDOW_WIDTH', width);
    },

    //  The Navbar
    arrangeStarredPagesLimited({ commit }, list) {
      commit('ARRANGE_STARRED_PAGES_LIMITED', list)
    },
    arrangeStarredPagesMore({ commit }, list) {
      commit('ARRANGE_STARRED_PAGES_MORE', list)
    },
    //cache Route
    addCacheRoute({commit},obj){
      commit('ADD_CACHE_ROUTE',obj)
    },
    deleteCacheRoute({commit},obj){
      commit('DELETE_CACHE_ROUTE',obj)
    },
    //token
    updateToken({commit},value){
      commit('UPDATE_TOKEN',value)
    },
    removeToken({commit}){
      commit('REMOVE_TOKEN')
    },
    //登录信息
    saveLoginInfo({commit},obj){
      commit('SAVE_LOGIN_INFO',obj)
    },
    removeLoginInfo({commit}){
      commit('SAVE_LOGIN_INFO')
    },

    // 账户模块初始化信息
    // initialInfo({commit},obj){
    //   commit('INITIALIZED_DETAIL_DATA',obj)
    // }

}

export default actions
